Chat 20260514 130223#306
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
|
Warning Rate limit exceeded
You’ve run out of usage credits. Purchase more in the billing tab. ⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: ⛔ Files ignored due to path filters (3)
📒 Files selected for processing (10)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
@copilot review but do not make fixes |
|
Capy auto-review is paused for this organization because the monthly auto-review limit has been reached. Increase the limit or turn it off in billing settings to resume automatic reviews. |
|
@copilot review but do not make fixes |
Summary
Describe the change.
What Changed
Key files and behaviors.
Validation
How you tested.
Risks
Anything to watch.
Greptile Summary
This PR introduces a pending-image-attachment UX: while clipboard or file images are being saved to disk, the attachment tray shows a cancellable thumbnail so the send button is disabled until the save completes. A new
appSaveClipboardImageAttachmentIPC handler reads the Electron clipboard, writes the PNG to.ade/attachments/, and returns a downsized 96×96 preview, avoiding the previous pattern of routing the full base64 payload through the renderer.appSaveClipboardImageAttachment): reads clipboard PNG in the main process, saves it with the sharedsaveAgentChatTempAttachmentBufferhelper, and returns a compact preview data URL instead of the full image bytes.pendingImageAttachments,imagePreviewUrls): composer tracks in-flight saves;ChatAttachmentTrayrenders aPendingImageAttachmentPreviewspinner with a blob-URL thumbnail while the temp file write is in progress.ImageAttachmentPreviewreceives the already-computed URL asinitialPreviewUrl, skipping the asyncgetImageDataUrlIPC round-trip entirely.Confidence Score: 5/5
Safe to merge — no functional regressions identified; the pending-attachment flow is guarded correctly at every async boundary.
The new IPC handler and React state machinery are each internally consistent. The cancellation ref is checked after every await, the object URL lifecycle is managed through effects with correct prev/current diffing, and the composerInputLocked effect's early-return guard prevents the pendingImageAttachments dep from causing spurious cancellations. The one suggestion is a dep-array tidyup that doesn't change runtime behavior.
No files require special attention; the most complex logic is in AgentChatComposer.tsx but its pending-attachment state machine is well-tested by the new test cases.
Important Files Changed
Sequence Diagram
sequenceDiagram participant User participant Renderer as AgentChatComposer participant Tray as ChatAttachmentTray participant Main as Main Process (IPC) participant FS as Filesystem User->>Renderer: Cmd+V / Paste / Drop image Renderer->>Renderer: addPendingImageAttachment() Renderer->>Tray: render PendingImageAttachmentPreview alt Native clipboard path Renderer->>Main: IPC: appSaveClipboardImageAttachment Main->>FS: writeFile(.ade/attachments/uuid.png) Main->>Main: image.resize(96x96) toDataURL() Main-->>Renderer: path + previewDataUrl else File-backed path Renderer->>Renderer: createObjectURL(file) Renderer->>Main: IPC: agentChatSaveTempAttachment Main->>FS: writeFile(.ade/attachments/uuid.ext) Main-->>Renderer: path end Renderer->>Renderer: onAddAttachment + dropPendingImageAttachment Renderer->>Tray: render ImageAttachmentPreview with initialPreviewUrlComments Outside Diff (1)
apps/desktop/src/main/services/ipc/registerIpc.ts, line 3605-3617 (link)In the legacy path (when
saveClipboardImageAttachmentis absent),previewDataUrlis constructed as`data:${legacyPayload.mimeType};base64,${legacyPayload.data}`wherelegacyPayload.datais the raw full-size PNG base64 (up to ~13 MB for a 10 MB image). This string is stored inimagePreviewUrlsReact state for the lifetime of the attachment. The new IPC path returns a 96×96 thumbnail instead; the fallback silently gives up that optimization and keeps a large string in the renderer heap until the attachment is removed.Prompt To Fix With AI
Prompt To Fix All With AI
Reviews (2): Last reviewed commit: "ship: iteration 1 - address pasted image..." | Re-trigger Greptile